from django.db import models


class AdminRecord(models.Model):
    group = models.PositiveSmallIntegerField(choices=(
        (1, '系统'),
        (2, '资讯'),
        (3, '会员'),
        (4, '商品'),
        (5, '订单')
    ), verbose_name='日志类型')
    detail = models.TextField(verbose_name='详情')
    date_add = models.DateTimeField(auto_now_add=True, verbose_name='添加时间')
    admin = models.ForeignKey(to='admins.Admins', on_delete=models.DO_NOTHING, db_constraint=False,
                              related_name='record')

    class Meta:
        db_table = 'zeus_admin_record'
        verbose_name = '日志'
        verbose_name_plural = verbose_name
